#pragma once

#include	<Net.h>
#include	<Singleton.h>

#define		GService	GameService::Instance()

class GameService : public IBaseService, public ISingleton<GameService> {
public:
	GameService() : IBaseService("game"), _ip(), _port(0) {}
	virtual ~GameService() {}

	virtual void OnReceive(Sender * sender, Protocol * msg) override;
	virtual void OnClose(Sender * sender, ENet::Close reason) override;
	
	bool Initialize(const std::string & ip, int port);
	void Register();

private:
	std::string _ip;
	int _port;
};